
package com.weiqiao.report.distributior.repository.impl;

import com.weiqiao.base.dao.impl.BaseMongoDaoImpl;
import com.weiqiao.report.distributior.repository.IOrderRepository;
import org.bson.Document;
import org.bson.conversions.Bson;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 订单持久化层
 *
 * @author ChenYF
 */
@Repository("ReportOrderRepositoryImpl")
public class OrderRepositoryImpl extends BaseMongoDaoImpl implements IOrderRepository {

    private String collectionName = "orders_";

    @Override
    public int countNum(int company_id, Bson filter) {
        return this.statististics(collectionName + company_id, filter);
    }

    @Override
    public List<String> getOrderListAndPage(int company_id, Bson filter, Bson sort, int skip, int pageSize) {
        return this.findFilterSortSkipLimit(collectionName + company_id, filter, sort, skip, pageSize);
    }

    @Override
    public List<String> getOrderList(int company_id, Bson filter) {
        return super.findFilter(collectionName + company_id, filter);
    }
}
